<template>
  <input type="text" v-model="wd">
  <button @click="handleSubmit">submit</button>
</template>
<script setup>
import { ref } from "vue"

const wd = ref("")
// const emits = defineEmits(["event1", "event2"])
// 第一步：自定义事件
const emits = defineEmits(["current-value"])
const handleSubmit = () => {
  // 第二步：自定义事件传值
  emits("current-value", wd.value)
  // console.log(wd.value)
}
</script>

